﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BindOne.aspx.cs" Inherits="MxWeiXinPF.Web.weixin.jiaoshuifei.BindOne" %>

<!DOCTYPE html>

<html>
<head runat="server">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">

    <link href="css/weui.min.css?v=2" rel="stylesheet" />
    <link href="css/jquery-weui.min.css" rel="stylesheet" />
    <link href="css/demos.css" rel="stylesheet" />

    <title>绑定户号</title>
</head>
<body ontouchstart>

 
    <div class="weui-cells weui-cells_form">



        <div class="weui-cell">
            <div class="weui-cell__hd">
                <label class="weui-label">用户号</label>
            </div>
            <div class="weui-cell__bd">
                <input class="weui-input" placeholder="请输入用户号" type="number" id="usernumber" />
            </div>
        </div>
        <div class="weui-cell">
            <div class="weui-cell__hd">
                <label class="weui-label">用户名</label>
            </div>
            <div class="weui-cell__bd">
                <input class="weui-input" placeholder="请输入用户名" id="username" />
            </div>
        </div>
        <input type="hidden" id="openID" value="<%=openid %>" />




    </div>

    <div class='demos-content-padded'>
        <a class="weui-btn weui-btn_primary" href="javascript:" id="showTooltips" onclick="bind()">提交</a>


    </div>

    <div class='demos-content-padded'>
        <div class="icon-box">

            <div class="icon-box__ctn">
                <h3 class="icon-box__title"><i class="weui-icon-info-circle"></i>温馨提示</h3>
                <p class="icon-box__desc">
                     <%=tel %>
                </p>
            </div>
        </div>
    </div>


    <script src="//cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script src="js/jquery-weui.js"></script>

    <script>
        //绑定用户号
        function bind() {
            var usernumber = $("#usernumber").val();
            var username = $("#username").val();
            if (usernumber == null || usernumber == "") {
                $.toptip('请输入用户号');
                retturn;
            }
            if (username == null || username == "") {
                $.toptip('请输入用户名');
                retturn;
            }
            //验证通过
            $.ajax({
                type: "post",
                url: "jsf_bindOne.ashx",
                data: { usernumber: usernumber, username: username, actionType: "bind", wid: '<%=wid%>', openid: '<%=openid%>' },
                beforeSend: function () {
                    $.showLoading();
                },
                success: function (data) {
                    if (data.succuss == 1) {
                        $.hideLoading();
                        $.alert("绑定成功。", function () {
                            //点击确认后的回调函数
                            window.location.href = "bindlist.aspx?wid=<%=wid%>";
                        });
                    }
                    else {
                        $.hideLoading();
                        $.toptip(data.msg);
                    }
                }
            });
        }

    </script>
</body>
</html>
